#ifndef UTILS_CC
#define UTILS_CC

#include<string>
#include<fstream>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<iterator>
#include<vector>
#include<map>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<random>
#include "def.hpp"
#include "utils.hpp"


using namespace std;

using namespace Puza;

double l1_distance(double*& a, double*& b, int& K){
  double result = 0.0;
  for(int k=0; k < K; k ++){
    result = result + fabs(a[k] - b[k]);
  }
  return result;
}

double l2_distance(double*& a, double*& b, int& K){
  double result = 0.0;
  for(int k=0; k < K ; k++){
    result = result + (a[k] - b[k]) * (a[k] - b[k]);
  }
  result = sqrt(result);
  return result;
}

double gaussian_random_variable(double mean, double sigma){
	 normal_distribution<double> normal(mean, sigma);
	 return normal(PuzaDEF::Instance()->rn_eng);
}

double sigmoid_function(double x){
	return 1.0 / (1 + exp(-x));
}

#endif
